package com.shunda.web.controller.system;

import com.shunda.common.core.controller.BaseController;
import com.shunda.common.core.page.TableDataInfo;
import com.shunda.system.domain.SysUserDutyLog;
import com.shunda.system.service.ISysUserDutyLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: dongyq
 * @date: 2025/3/26 18:13
 * @since: 1.0.0
 * @功能描述: 用户值班日志
 */
@RestController
@RequestMapping("/system/duty")
public class SysUserDutyLogController extends BaseController {

    @Autowired
    private ISysUserDutyLogService sysUserDutyLogService;

    @GetMapping
    public TableDataInfo getDutyList(@RequestParam(required = false) String deptId, @RequestParam(required = false) String userId) {
        startPage();
        List<SysUserDutyLog> dutyList = sysUserDutyLogService.selectUserDutyLog(deptId, userId);
        return getDataTable(dutyList);
    }
}
